<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Free Software" and "Free Software Needs
Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
and with the Back-Cover Texts as in (a) below.

(a) The FSF's Back-Cover Text is: "You are free to copy and modify
this GNU Manual.  Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom." -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Debugging with GDB: Manually</title>

<meta name="description" content="Debugging with GDB: Manually">
<meta name="keywords" content="Debugging with GDB: Manually">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Setting.html#Setting" rel="up" title="Setting">
<link href="Automatically.html#Automatically" rel="next" title="Automatically">
<link href="Filenames.html#Filenames" rel="prev" title="Filenames">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Manually"></a>
<div class="header">
<p>
Next: <a href="Automatically.html#Automatically" accesskey="n" rel="next">Automatically</a>, Previous: <a href="Filenames.html#Filenames" accesskey="p" rel="prev">Filenames</a>, Up: <a href="Setting.html#Setting" accesskey="u" rel="up">Setting</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Setting-the-Working-Language"></a>
<h4 class="subsection">15.1.2 Setting the Working Language</h4>

<p>If you allow <small>GDB</small> to set the language automatically,
expressions are interpreted the same way in your debugging session and
your program.
</p>
<a name="index-set-language"></a>
<p>If you wish, you may set the language manually.  To do this, issue the
command &lsquo;<samp>set language <var>lang</var></samp>&rsquo;, where <var>lang</var> is the name of
a language, such as
<code>c</code> or <code>modula-2</code>.
For a list of the supported languages, type &lsquo;<samp>set language</samp>&rsquo;.
</p>
<p>Setting the language manually prevents <small>GDB</small> from updating the working
language automatically.  This can lead to confusion if you try
to debug a program when the working language is not the same as the
source language, when an expression is acceptable to both
languages&mdash;but means different things.  For instance, if the current
source file were written in C, and <small>GDB</small> was parsing Modula-2, a
command such as:
</p>
<div class="smallexample">
<pre class="smallexample">print a = b + c
</pre></div>

<p>might not have the effect you intended.  In C, this means to add
<code>b</code> and <code>c</code> and place the result in <code>a</code>.  The result
printed would be the value of <code>a</code>.  In Modula-2, this means to compare
<code>a</code> to the result of <code>b+c</code>, yielding a <code>BOOLEAN</code> value.
</p>



</body>
</html>
